<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<p:growl />
			<h:outputText value="Create New Logistic(s)" styleClass="outputTextTitle" />
			<h:panelGrid columns="3" >
				<h:outputLabel value="#{msg['logisticname.label']} " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createLogisticsBean.logistics.logistics}" />

				<h:outputLabel value="#{msg['displayname.label']}" />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createLogisticsBean.logistics.displayName}" />
				
				<h:outputLabel value="#{msg['dispalyorder.label']}" />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createLogisticsBean.logistics.displayOrder}" />
				
				<h:outputLabel value="#{msg['logisticfor.label']}" />
				<h:outputLabel value=" : " />
				<p:selectOneMenu value="#{createLogisticsBean.logistics.logisticsFor}" style="width:136px;">
					<f:selectItems value="#{createLogisticsBean.travelListMap}"/>
				</p:selectOneMenu>
				
				<h:outputLabel value="#{msg['description.label']} " />
				<h:outputLabel value=" : " />
				<p:inputTextarea value="#{createLogisticsBean.logistics.description}" />
				<h:inputHidden />
				<h:inputHidden />
		</h:panelGrid>
		
		<p:commandButton value="#{createLogisticsBean.assignViewAllLogisticsLabel}" actionListener="#{createLogisticsBean.toggleAssignPanelDisplay}" update="assignPanel" ajax="false" />
		
		<p:panel id="assignPanel" style="width: 100%" rendered="#{createLogisticsBean.viewLogisticsList}" >
		
		 <h:panelGrid style="width: 100%; text-align: left; ">
		    <h:outputText value="Available Travel Logistics" styleClass="outputTextSubTitle" />
								
		     <p:dataTable id="travelLogisticsTable" style="width: 100%"
									value="#{createLogisticsBean.ligisticsList}"
									selection="#{createLogisticsBean.selectedLogistics}" var="row"
									selectionMode="multiple" rowKey="#{row.logisticsId}">
									<p:column>
										<f:facet name="header">
											<h:outputText value="Logistic Name" />
										</f:facet>
										<h:outputText value="#{row.logistics}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Display Name" />
										</f:facet>
										<h:outputText value="#{row.displayName}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Logistic For" />
										</f:facet>
										<h:outputText value="#{row.logisticsFor}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Display Order" />
										</f:facet>
										<h:outputText value="#{row.displayOrder}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Description" />
										</f:facet>
										<h:outputText value="#{row.description}" />
									</p:column>
									

								</p:dataTable>
				</h:panelGrid>
			
		</p:panel>	
				<p:commandButton value="Save Logistic"
					actionListener="#{createLogisticsBean.saveTravelLogistic}" ajax="false" /> 
			

		</h:form>
	</ui:define>
</ui:composition>